package com.www.dapi;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class Demo {

	public static void main(String[] args) {
		// 读取配置文件
//		Properties pro = new  Properties();
		Properties properties = new Properties();
		InputStream resourceAsStream = Demo.class.getClassLoader().getResourceAsStream("application.properties");
		try {
			pro.load(resourceAsStream);
			String  value = (String) pro.get("service.port");
			System.out.println(value);
			System.out.println(value+"-----"+value);
		} catch (IOException e) {
			e.printStackTrace();
		}finally {
			if(resourceAsStream!=null){
				try {
					resourceAsStream.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}

	}
	
	public void getName(){
		System.out.println("Hello World!");
	}
}
